package com.jpa.yuan.control;

//import com.jpa.yuan.mapper.PersonReposotry;

import com.jpa.yuan.mapper.Userrepo;
import com.jpa.yuan.vo.Teacher;
import com.jpa.yuan.vo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;
import java.util.Optional;

/**
 * @ClassName: teachercontrol
 * @Description: TODO
 * @Author MrYuan
 * @Date: 2021/1/28 9:35
 * @Version 1.0
 */
@RestController
public class teachercontrol {
//    @Autowired
//    PersonReposotry p;

    @Autowired
    Userrepo u;

    @GetMapping("teacher")
    private List<Teacher> getteacher() {
//        List<Teacher> teachers = p.get(1);
//        return teachers;
        return new ArrayList<Teacher>();
    }

    @GetMapping("pu")
    private User getpv() {
        Optional<User> li3 = u.findOne(Example.of(new User().setLastName("li3").setId(3)));
        User user = li3.get();
        return user;
    }
}

